package day11.task;

import java.security.Key;
import java.util.*;

public class Poem {
    private String key;
    private String author;
    private String value;

    public Poem(){

    }

    public Poem(String key, String author, String value) {
        this.key = key;
        this.author = author;
        this.value = value;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static void main(String[] args) {
        List<Poem> list=new ArrayList<>();
        list.add(new Poem("静夜思","李白"," 内容：床前明月光，疑似地上霜，举头望明月，疑似地上霜。"));
        list.add(new Poem("赠汪伦","李白"," 内容：李白乘舟将欲行，忽闻岸上踏歌声。桃花潭水深千尺，不及汪伦送我情。"));
        Map<String,String> map=new HashMap<>();
        for(Poem poem:list){
            map.put(poem.getKey(), poem.getAuthor()+poem.getValue());
        }
        Set<String> keys = map.keySet();
        for (String key : keys) {
            String v = map.get(key);
            System.out.println(key + " 作者 " + v);
        }
    }
}
